package com.fmy.test.config.dynamic;

import com.fmy.test.config.dynamic.holder.DynamicContextHolder;
import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;

/**
 * @Auther: Mr.fmy
 * @Date: 2019/8/24 0024 17:20
 * @Description: <p></p>
 */
public class DynamicDataSource extends AbstractRoutingDataSource {

    @Override
    protected Object determineCurrentLookupKey() {
        return DynamicContextHolder.get().getDbName();
    }
}
